import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_native_setting_plugin/flutter_native_setting_plugin.dart';
import 'package:flutter_native_setting_plugin/flutter_native_setting_plugin_platform_interface.dart';
import 'package:flutter_native_setting_plugin/flutter_native_setting_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterNativeSettingPluginPlatform
    with MockPlatformInterfaceMixin
    implements FlutterNativeSettingPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterNativeSettingPluginPlatform initialPlatform = FlutterNativeSettingPluginPlatform.instance;

  test('$MethodChannelFlutterNativeSettingPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterNativeSettingPlugin>());
  });

  test('getPlatformVersion', () async {
    FlutterNativeSettingPlugin flutterNativeSettingPlugin = FlutterNativeSettingPlugin();
    MockFlutterNativeSettingPluginPlatform fakePlatform = MockFlutterNativeSettingPluginPlatform();
    FlutterNativeSettingPluginPlatform.instance = fakePlatform;

    expect(await flutterNativeSettingPlugin.getPlatformVersion(), '42');
  });
}
